
<html>
<body onload="onSelectCascade('firstCategory','secondCategory');onSelectCascade('secondCategory','thirdCategory');onAutoFillPosition('firstCategory,secondCategory,thirdCategory,client');">
<div id="container">
	<%@ include file="/WEB-INF/page/common/header.jsp" %>	
	<div id="navigator">
 		<a href="<c:url value="/common/home.o"/>"><fmt:message key="label.common.home" /></a> > 
 		<a href="<c:url value="/event/query.o"/>"><fmt:message key="label.event.model" /></a> > 
 		<fmt:message key="${ACTION}" />
 		<%@ include file="/WEB-INF/page/common/navigator.jsp" %>
    </div>
	<div id="midbody">
	     <div id="leftside">
	     	<br>
		    <shiro:hasPermission name="event:query">
	            <a href="<c:url value="/event/query.o"/>"><fmt:message key="label.event.action.listall" /></a>
	            &nbsp;&nbsp;&nbsp;&nbsp;
	        </shiro:hasPermission>
		</div>
	    <div id="rightside">	    	
		    <div id="bigbox">
		        <div class="title clearfix">
		        	<div style="float: left">
		        		<fmt:message key="${ACTION}" /> <fmt:message key="label.event.model" />
		        	</div>
		        	<%@ include file="/WEB-INF/page/common/hidemenu.jsp" %>
		        </div>
		        <div class="content">
	            <form:form modelAttribute="eventStruct">
	            	<input type="hidden" id="ACTION" name="ACTION">
	                <form:errors path="*" element="div" cssClass="errors"/>
		    		<table id="detailTable" width="100%">
		    			<% out.print(request.getAttribute("eventDetailTable")); %>
		    			<c:forEach var="execute" items="${eventStruct.executes}" varStatus="index">
		    			<tr>
		    				<td valign="top">
		    					<fmt:message key="label.execute_unit.model" />&nbsp;
		    					[&nbsp;<c:out value="${execute.executeUnit.name}" />&nbsp;]
		    				</td>
		    				<c:if test="${ACTION == 'edit' && execute.status != 'executed'}">
		    				<td colspan="3">
	    						<table width="100%">
	    							<tr>
	    								<td width="20%">
	    									<fmt:message key="label.event_execute.field.status" />:
	    								</td>
	    								<td width="30%">
	    									<fmt:message key="common.single.select.execute_status.${execute.status}" />
	    								</td>
										<td width="20%">
		    								<fmt:message key="label.event_execute.field.assignDate" />:
		    							</td>
		    							<td>
		    								<fmt:formatDate  value="${execute.assignDate}" pattern="yyyy-MM-dd HH:mm"/>
		    							</td>
		    						</tr>
									<tr>
										<td>
											<fmt:message key="label.event_execute.field.department" />:
										</td>
										<td>
											<input type="text" size="20" name="execute.department.<c:out value='${execute.id}' />" value="<c:out value="${execute.department}" />" >
										</td>
										<td>
											<fmt:message key="label.event_execute.field.progress" />:
										</td>
										<td>
											<select name="execute.progress.<c:out value='${execute.id}' />">
												<option></option>
												<option value="1" 
												<c:if test="${execute.progress == '1'}">
													selected="selected"
												</c:if>
												><fmt:message key="common.single.select.execute_progress.1" /></option>
												<option value="2"
												<c:if test="${execute.progress == '2'}">
													selected="selected"
												</c:if>
												><fmt:message key="common.single.select.execute_progress.2" /></option>
												<option value="3"
												<c:if test="${execute.progress == '3'}">
													selected="selected"
												</c:if>
												><fmt:message key="common.single.select.execute_progress.3" /></option>
												<option value="4"
												<c:if test="${execute.progress == '4'}">
													selected="selected"
												</c:if>
												><fmt:message key="common.single.select.execute_progress.4" /></option>
												<option value="5"
												<c:if test="${execute.progress == '5'}">
													selected="selected"
												</c:if>
												><fmt:message key="common.single.select.execute_progress.5" /></option>
												<option value="6"
												<c:if test="${execute.progress == '6'}">
													selected="selected"
												</c:if>
												><fmt:message key="common.single.select.execute_progress.6" /></option>
											</select>
										</td>
									</tr>
									<tr>
										<td>
											<fmt:message key="label.event_execute.field.executed" />:
										</td>
										<td>
	    									<c:if test="${execute.executed == true}">
	    										<c:if test="${not empty execute.executeUnit.integrated && execute.executeUnit.integrated == true}">
	    											<input type="checkbox" name="execute.executed.<c:out value='${execute.id}' />" value="true" checked="checked" disabled="disabled">
	    											<input type="hidden" name="execute.executed.<c:out value='${execute.id}' />" value="true" >
	    										</c:if>
	    										<c:if test="${empty execute.executeUnit.integrated || execute.executeUnit.integrated == false}">
    												<input type="checkbox" name="execute.executed.<c:out value='${execute.id}' />" value="true" checked="checked">
    											</c:if>
    										</c:if>
	    									<c:if test="${execute.executed == false}">
	    										<input type="checkbox" name="execute.executed.<c:out value='${execute.id}' />" value="true"s >
	    									</c:if>
										</td>
										<td>
		    								<fmt:message key="label.event_execute.field.executeDate" />:
		    							</td>
		    							<td>
		    								<fmt:formatDate  value="${execute.executeDate}" pattern="yyyy-MM-dd HH:mm"/>
		    							</td>
		    						</tr>
		    						<tr>
										<td>
											<fmt:message key="label.event_execute.field.preHandleImgUrl" />:
										</td>
											<td colspan="3">
											<input type="text" size="50" name="execute.preHandleImgUrl.<c:out value='${execute.id}' />" value="<c:out value="${execute.preHandleImgUrl}" />" >
										</td>
									</tr>
									<tr>
										<td>
											<fmt:message key="label.event_execute.field.postHandleImgUrl" />:
										</td>
											<td colspan="3">
											<input type="text" size="50" name="execute.postHandleImgUrl.<c:out value='${execute.id}' />" value="<c:out value="${execute.postHandleImgUrl}" />" >
										</td>
									</tr>
									<tr>
										<td valign="top">
											<fmt:message key="label.event_execute.field.response" />:
										</td>
										<td colspan="3">
											<textarea name="execute.response.<c:out value='${execute.id}' />" style="margin:2px;width:400px;height:100px;"><c:out value="${execute.response}" /></textarea>
		    							</td>
		    						</tr>
		    					</table>
		    				</td>
		    				</c:if>
		    				<c:if test="${ACTION == 'view' || execute.status == 'executed'}">
		    				<td colspan="3">
		    					<table width="100%">
	    							<tr>
	    								<td width="20%">
	    									<fmt:message key="label.event_execute.field.status" />:
	    								</td>
	    								<td width="30%">
	    									<fmt:message key="common.single.select.execute_status.${execute.status}" />
	    								</td>
	    								<td width="20%">
		    								<fmt:message key="label.event_execute.field.assignDate" />:
		    							</td>
		    							<td>
		    								<fmt:formatDate  value="${execute.assignDate}" pattern="yyyy-MM-dd HH:mm"/>
		    							</td>
		    						</tr>
									<tr>
										<td>
											<fmt:message key="label.event_execute.field.department" />:
										</td>
										<td>
											<c:out value="${execute.department}" />
										</td>
										<td>
											<fmt:message key="label.event_execute.field.progress" />:
										</td>
										<td>
											<c:if test="${execute.progress != null}">
											<fmt:message key="common.single.select.execute_progress.${execute.progress}" />
											</c:if>
										</td>
									</tr>
	    							<tr>
	    								<td>
	    									<fmt:message key="label.event_execute.field.executed" />:
	    								</td>
	    								<td>
	    									<c:if test="${execute.executed == true}">
	    										<fmt:message key="label.common.yes" />
	    									</c:if>
	    									<c:if test="${execute.executed == false}">
	    										<fmt:message key="label.common.no" />
	    									</c:if>
	    								</td>
	    								<td>
		    								<fmt:message key="label.event_execute.field.executeDate" />:
		    							</td>
		    							<td>
		    								<fmt:formatDate  value="${execute.executeDate}" pattern="yyyy-MM-dd HH:mm"/>
		    							</td>
		    						</tr>
		    						<tr>
										<td>
											<fmt:message key="label.event_execute.field.preHandleImgUrl" />:
										</td>
											<td colspan="3">
											<c:out value="${execute.preHandleImgUrl}" />
										</td>
									</tr>
									<tr>
										<td>
											<fmt:message key="label.event_execute.field.postHandleImgUrl" />:
										</td>
											<td colspan="3">
											<c:out value="${execute.postHandleImgUrl}" />
										</td>
									</tr>
									<tr>
										<td valign="top">
											<fmt:message key="label.event_execute.field.response" />:
										</td>
		    							<td colspan="3">
		    								<c:out escapeXml="false" value="${execute.response}" />
		    							</td>
		    						</tr>
		    					</table>
		    				</td>
		    				</c:if>
		    			</tr>
		    			</c:forEach>
		    		</table>
		    		<table id="detailButtons" width="100%">
	    				<% out.print(request.getAttribute("eventDetailButtons")); %>
	    			</table>
	            </form:form>
		        </div>
		    </div>
		</div>
	</div>
	<%@ include file="/WEB-INF/page/common/foot.jsp" %>

</div>
  
</body>
</html>
